package router

import (
	"github.com/gin-gonic/gin"
	"github.com/smash-llj/Nexa-server/api"
)

func InitGroupRoutes() {
	//注册当前大模块到gfnRoutes里面
	RegisterRoute(func(rgPublic *gin.RouterGroup, tgAuth *gin.RouterGroup) {
		groupApi := api.NewGroupApi()
		publicGroupRouter(tgAuth, groupApi)
	})
}
func publicGroupRouter(tgAuth *gin.RouterGroup, api api.GroupApi) {
	tgAuth.POST("/createGroup", api.CreateGroup)
	tgAuth.POST("/joinGroup", api.JoinGroup)
	tgAuth.POST("/getGroupMessage", api.GetGroupMessage)
	tgAuth.GET("/detailGroup/:groupId", api.DetailGroup)
	tgAuth.GET("/getJoinGroup", api.GetUserGroups)
	tgAuth.GET("/groupMemberList/:groupId", api.GetGroupMemberList)
	tgAuth.POST("/updateGroupInfo", api.UpdateGroupInfo)
}
